Time Base Callback Functions
If your application uses QuickTime time bases, it may define callback functions that are associated with a specific time base. Your application can then use these callback functions to perform activities that are triggered by temporal events, such as a certain time being reached or a specified rate being achieved. The time base functions of the Movie Toolbox interact with clock components to schedule the invocation of these callback functions--clock components are responsible for invoking the callback function at its scheduled time. Your application can use the functions described in this section to establish your own callback function and to schedule callback events.You can define three types of callback events. These types are distinguished by the nature of the temporal event that triggers the Movie Toolbox to call your function. The three types are
You specify a callback event's type when you define the callback event, using the
- events that are triggered at a specified time
- events that are triggered when the rate reaches a specified value
- events that are triggered when the time value of a time base changes by an amount different from the time base's rate
NewCallBack
function.You specify whether your event can occur at interrupt time when you define the callback event, using the
NewCallBack
function. Your function is called closer to the triggering event at interrupt time, but it is subject to all the restrictions of interrupt functions (for example, your callback function cannot cause memory to be moved). If your function is not called at interrupt time, you are free of these restrictions--but your function may be called later, because the invocation is delayed to avoid interrupt time.The
NewCallBack
function allocates the memory to support a callback event.
When you are done with the callback event, you dispose of it by calling theDisposeCallBack
function.You schedule a callback event by calling the
CallMeWhen
function. CallCancelCallBack
function to unschedule a callback event.You can retrieve the time base of a callback event by calling the
GetCallBackTimeBase
function. You can obtain the type of a callback event by calling theGetCallBackType
function.
Subtopics
- NewCallBack
- CallMeWhen
- CancelCallBack
- DisposeCallBack
- GetCallBackTimeBase
- GetCallBackType